{% include 'header.html' %}
	
    {% if user %}
		<strong>Getting Started:</strong> Add your work and personal e-mail addresses at the bottom to start using OneGraph.<br/><br/>
		<em>Logged in as: {{ user.nickname }}. Tracking the following e-mail account(s): </em>
		
		{% if myemails %}
		    <ul class="tracking">
			{% for myemail in myemails %}
				<li>{{ myemail }}</li>
			{% endfor %}
			</ul>
		{% else %}
			<span class="highlight">None, please go to the bottom of the page and add your e-mail addresses</span>
		{% endif %}
		
		<h2>My OneGraph</h2>
		<form action="/addfriend" method="post">
			<div>First Name: <input name="firstname" rows="1" cols="15"></input>
	      	Last Name: <input name="lastname" rows="1" cols="25"></input>
	      	Email: <input name="email" rows="1" cols="25"></input>
	      	<input type="submit" value="Quick Add Friend" class="button"></input></div>
	    </form>

		<table cellpadding="3" cellspacing="0" border="0" width="100%">
			<tr style="background-color: #ccc;">
				<th><strong>Name</strong></th>
				<th><strong>E-mail</strong></th>
				<th><strong>Date Added</strong></th>
				<th><strong>Social Interaction Score <span onClick="alert('This is cumulative amount of recent social activity you have had with this person')" class="whatsthis">What's This?</span></strong</th>
				<th></th>
			</tr>
			
			{% if myentities %}
				{% for entity in myentities %}
			        <tr style="background: {% cycle #C3FDB8,#B5EAAA %};" class="friendrow">
						<td>{{ entity.firstname }} {{ entity.lastname }}</td>
				        <td>{{ entity.email }}</td>
						<td>{{ entity.dateadded }}</td>
						<td>{{ entity.socialinteractionscore }}</td>
						<td><form action="/deletefriend" method="post">
							<input type="hidden" name="friend" id="friend" value="{{ entity.key.id }}" />
							<input type="submit" value="Remove" class="button" /></form></td>
					</tr>
				{% endfor %}
			{% endif %}
		</table>
	
		
		<form action="/addemail" method="post" id="addemail">
			<div>Your Work or Personal E-mail Address: <input name="useremailaddress" rows="1" cols="25"></input>
	      	<input type="submit" value="Quick Add Your E-mail Address" class="button"></input></div>
	    </form>
	
		<p>Note: This address will be used to extract your social graph and activity.<br/>

		<form action="/activitycheck" method="get"><input type="submit" value="Check for New Social Activity" class="button" /></input></form>
	    	<a href="{{ logouturl }}">Logout</a><br/><br/>
	      	<span class="highlight">Important:</span> You must CC or BCC your emails to <a href="mailto:onegraph.import@gmail.com">onegraph.import@gmail.com</a> to capture their graph here.
	
	{% else %}
		<p class="w2">You're invited to join this evolving experiment to help users maintain one single master social graph.</p>
		<ul>
			<li class="w2">Provides a simple, easy way to maintain a single set of contacts</li>
	      	<li class="w2">Works easily across your personal and work applications</li>
			<li class="w2">Will allow your social activity with your contacts to be tracked in one place</li>
		</ul>
		<a href="{{ loginurl }}">Sign-in or Register</a>

  	{% endif %}	
{% include 'footer.html' %}